package com.dt.platform.domain.hr;

import com.github.foxnic.dao.entity.Entity;
import io.swagger.annotations.ApiModel;
import javax.persistence.Table;
import com.github.foxnic.sql.meta.DBTable;
import com.dt.platform.constants.db.HrTables.HR_PAPER_RELEASE;
import javax.persistence.Id;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.Transient;
import com.github.foxnic.api.swagger.EnumFor;
import org.github.foxnic.web.domain.hrm.Organization;
import java.util.List;
import org.github.foxnic.web.domain.hrm.Employee;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.foxnic.commons.lang.DataParser;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import com.github.foxnic.dao.entity.EntityContext;
import com.dt.platform.domain.hr.meta.PaperReleaseMeta;
import com.github.foxnic.sql.data.ExprRcd;



/**
 * 考试下发
 * <p>考试下发 , 数据表 hr_paper_release 的PO类型</p>
 * @author 金杰 , maillank@qq.com
 * @since 2024-09-29 14:31:28
 * @sign B1426BA807055C31B851F5476B71D698
 * 此文件由工具自动生成，请勿修改。若表结构或配置发生变动，请使用工具重新生成。
*/

@Table(name = "hr_paper_release")
@ApiModel(description = "考试下发 ; 考试下发 , 数据表 hr_paper_release 的PO类型")
public class PaperRelease extends Entity {

	private static final long serialVersionUID = 1L;

	public static final DBTable TABLE =HR_PAPER_RELEASE.$TABLE;
	
	/**
	 * 主键：主键
	*/
	@Id
	@ApiModelProperty(required = true,value="主键" , notes = "主键" , example = "595144132206661")
	private String id;
	
	/**
	 * 当前试卷：当前试卷
	*/
	@ApiModelProperty(required = false,value="当前试卷" , notes = "当前试卷" , example = "595144132005957")
	private String paperId;
	
	/**
	 * 原始试卷：原始试卷
	*/
	@ApiModelProperty(required = false,value="原始试卷" , notes = "原始试卷" , example = "606495242186653701")
	private String sourcePaperId;
	
	/**
	 * 编号：编号
	*/
	@ApiModelProperty(required = false,value="编号" , notes = "编号" , example = "45065683")
	private String code;
	
	/**
	 * 启用状态：启用状态
	*/
	@ApiModelProperty(required = false,value="启用状态" , notes = "启用状态" , example = "enable")
	private String status;
	
	/**
	 * 下发状态：下发状态
	*/
	@ApiModelProperty(required = false,value="下发状态" , notes = "下发状态" , example = "not_distribute")
	private String releaseStatus;
	
	/**
	 * 学习课件：学习课件
	*/
	@ApiModelProperty(required = false,value="学习课件" , notes = "学习课件" , example = "606133466727186437")
	private String learnId;
	
	/**
	 * 关联学习：关联学习
	*/
	@ApiModelProperty(required = false,value="关联学习" , notes = "关联学习" , example = "no")
	private String ifLearn;
	
	/**
	 * 考试用时：考试用时
	*/
	@ApiModelProperty(required = false,value="考试用时" , notes = "考试用时" , example = "30")
	private Integer cost;
	
	/**
	 * 开始时间：开始时间
	*/
	@ApiModelProperty(required = false,value="开始时间" , notes = "开始时间" , example = "2024-09-05 09:21:39")
	private Date sdate;
	
	/**
	 * 结束时间：结束时间
	*/
	@ApiModelProperty(required = false,value="结束时间" , notes = "结束时间" , example = "2024-09-30 09:21:39")
	private Date edate;
	
	/**
	 * 是否全员：是否全员
	*/
	@ApiModelProperty(required = false,value="是否全员" , notes = "是否全员" , example = "no")
	private String ifAllUser;
	
	/**
	 * 选择部门：选择部门
	*/
	@ApiModelProperty(required = false,value="选择部门" , notes = "选择部门")
	private String selOrg;
	
	/**
	 * 下发时间：下发时间
	*/
	@ApiModelProperty(required = false,value="下发时间" , notes = "下发时间" , example = "2024-09-27 07:07:42")
	private Date rcdTime;
	
	/**
	 * 创建人ID：创建人ID
	*/
	@ApiModelProperty(required = false,value="创建人ID" , notes = "创建人ID" , example = "110588348101165911")
	private String createBy;
	
	/**
	 * 创建时间：创建时间
	*/
	@ApiModelProperty(required = false,value="创建时间" , notes = "创建时间" , example = "2024-09-27 07:07:42")
	private Date createTime;
	
	/**
	 * 修改人ID：修改人ID
	*/
	@ApiModelProperty(required = false,value="修改人ID" , notes = "修改人ID")
	private String updateBy;
	
	/**
	 * 修改时间：修改时间
	*/
	@ApiModelProperty(required = false,value="修改时间" , notes = "修改时间")
	private Date updateTime;
	
	/**
	 * 是否已删除：是否已删除
	*/
	@ApiModelProperty(required = true,value="是否已删除" , notes = "是否已删除" , example = "0")
	private Integer deleted;
	@Transient
	@EnumFor("deleted")
	private Boolean deletedBool;
	
	/**
	 * 删除人ID：删除人ID
	*/
	@ApiModelProperty(required = false,value="删除人ID" , notes = "删除人ID")
	private String deleteBy;
	
	/**
	 * 删除时间：删除时间
	*/
	@ApiModelProperty(required = false,value="删除时间" , notes = "删除时间")
	private Date deleteTime;
	
	/**
	 * version：version
	*/
	@ApiModelProperty(required = true,value="version" , notes = "version" , example = "1")
	private Integer version;
	
	/**
	 * 所属公司：所属公司
	*/
	@ApiModelProperty(required = false,value="所属公司" , notes = "所属公司")
	private List<Organization> selectOrg;
	
	/**
	 * 使用公司/部门：使用公司/部门
	*/
	@ApiModelProperty(required = false,value="使用公司/部门" , notes = "使用公司/部门")
	private List<String> selectOrgIds;
	
	/**
	 * 选择人员：选择人员
	*/
	@ApiModelProperty(required = false,value="选择人员" , notes = "选择人员")
	private List<Employee> selectUser;
	
	/**
	 * 选择人员：选择人员
	*/
	@ApiModelProperty(required = false,value="选择人员" , notes = "选择人员")
	private List<String> selectUserIds;
	
	/**
	 * paper：paper
	*/
	@ApiModelProperty(required = false,value="paper" , notes = "paper")
	private Paper paper;
	
	/**
	 * learn：learn
	*/
	@ApiModelProperty(required = false,value="learn" , notes = "learn")
	private Learn learn;
	
	/**
	 * 获得 主键<br>
	 * 主键
	 * @return 主键
	*/
	public String getId() {
		return id;
	}
	
	/**
	 * 设置 主键
	 * @param id 主键
	 * @return 当前对象
	*/
	public PaperRelease setId(String id) {
		this.id=id;
		return this;
	}
	
	/**
	 * 获得 当前试卷<br>
	 * 当前试卷
	 * @return 当前试卷
	*/
	public String getPaperId() {
		return paperId;
	}
	
	/**
	 * 设置 当前试卷
	 * @param paperId 当前试卷
	 * @return 当前对象
	*/
	public PaperRelease setPaperId(String paperId) {
		this.paperId=paperId;
		return this;
	}
	
	/**
	 * 获得 原始试卷<br>
	 * 原始试卷
	 * @return 原始试卷
	*/
	public String getSourcePaperId() {
		return sourcePaperId;
	}
	
	/**
	 * 设置 原始试卷
	 * @param sourcePaperId 原始试卷
	 * @return 当前对象
	*/
	public PaperRelease setSourcePaperId(String sourcePaperId) {
		this.sourcePaperId=sourcePaperId;
		return this;
	}
	
	/**
	 * 获得 编号<br>
	 * 编号
	 * @return 编号
	*/
	public String getCode() {
		return code;
	}
	
	/**
	 * 设置 编号
	 * @param code 编号
	 * @return 当前对象
	*/
	public PaperRelease setCode(String code) {
		this.code=code;
		return this;
	}
	
	/**
	 * 获得 启用状态<br>
	 * 启用状态
	 * @return 启用状态
	*/
	public String getStatus() {
		return status;
	}
	
	/**
	 * 设置 启用状态
	 * @param status 启用状态
	 * @return 当前对象
	*/
	public PaperRelease setStatus(String status) {
		this.status=status;
		return this;
	}
	
	/**
	 * 获得 下发状态<br>
	 * 下发状态
	 * @return 下发状态
	*/
	public String getReleaseStatus() {
		return releaseStatus;
	}
	
	/**
	 * 设置 下发状态
	 * @param releaseStatus 下发状态
	 * @return 当前对象
	*/
	public PaperRelease setReleaseStatus(String releaseStatus) {
		this.releaseStatus=releaseStatus;
		return this;
	}
	
	/**
	 * 获得 学习课件<br>
	 * 学习课件
	 * @return 学习课件
	*/
	public String getLearnId() {
		return learnId;
	}
	
	/**
	 * 设置 学习课件
	 * @param learnId 学习课件
	 * @return 当前对象
	*/
	public PaperRelease setLearnId(String learnId) {
		this.learnId=learnId;
		return this;
	}
	
	/**
	 * 获得 关联学习<br>
	 * 关联学习
	 * @return 关联学习
	*/
	public String getIfLearn() {
		return ifLearn;
	}
	
	/**
	 * 设置 关联学习
	 * @param ifLearn 关联学习
	 * @return 当前对象
	*/
	public PaperRelease setIfLearn(String ifLearn) {
		this.ifLearn=ifLearn;
		return this;
	}
	
	/**
	 * 获得 考试用时<br>
	 * 考试用时
	 * @return 考试用时
	*/
	public Integer getCost() {
		return cost;
	}
	
	/**
	 * 设置 考试用时
	 * @param cost 考试用时
	 * @return 当前对象
	*/
	public PaperRelease setCost(Integer cost) {
		this.cost=cost;
		return this;
	}
	
	/**
	 * 获得 开始时间<br>
	 * 开始时间
	 * @return 开始时间
	*/
	public Date getSdate() {
		return sdate;
	}
	
	/**
	 * 设置 开始时间
	 * @param sdate 开始时间
	 * @return 当前对象
	*/
	public PaperRelease setSdate(Date sdate) {
		this.sdate=sdate;
		return this;
	}
	
	/**
	 * 获得 结束时间<br>
	 * 结束时间
	 * @return 结束时间
	*/
	public Date getEdate() {
		return edate;
	}
	
	/**
	 * 设置 结束时间
	 * @param edate 结束时间
	 * @return 当前对象
	*/
	public PaperRelease setEdate(Date edate) {
		this.edate=edate;
		return this;
	}
	
	/**
	 * 获得 是否全员<br>
	 * 是否全员
	 * @return 是否全员
	*/
	public String getIfAllUser() {
		return ifAllUser;
	}
	
	/**
	 * 设置 是否全员
	 * @param ifAllUser 是否全员
	 * @return 当前对象
	*/
	public PaperRelease setIfAllUser(String ifAllUser) {
		this.ifAllUser=ifAllUser;
		return this;
	}
	
	/**
	 * 获得 选择部门<br>
	 * 选择部门
	 * @return 选择部门
	*/
	public String getSelOrg() {
		return selOrg;
	}
	
	/**
	 * 设置 选择部门
	 * @param selOrg 选择部门
	 * @return 当前对象
	*/
	public PaperRelease setSelOrg(String selOrg) {
		this.selOrg=selOrg;
		return this;
	}
	
	/**
	 * 获得 下发时间<br>
	 * 下发时间
	 * @return 下发时间
	*/
	public Date getRcdTime() {
		return rcdTime;
	}
	
	/**
	 * 设置 下发时间
	 * @param rcdTime 下发时间
	 * @return 当前对象
	*/
	public PaperRelease setRcdTime(Date rcdTime) {
		this.rcdTime=rcdTime;
		return this;
	}
	
	/**
	 * 获得 创建人ID<br>
	 * 创建人ID
	 * @return 创建人ID
	*/
	public String getCreateBy() {
		return createBy;
	}
	
	/**
	 * 设置 创建人ID
	 * @param createBy 创建人ID
	 * @return 当前对象
	*/
	public PaperRelease setCreateBy(String createBy) {
		this.createBy=createBy;
		return this;
	}
	
	/**
	 * 获得 创建时间<br>
	 * 创建时间
	 * @return 创建时间
	*/
	public Date getCreateTime() {
		return createTime;
	}
	
	/**
	 * 设置 创建时间
	 * @param createTime 创建时间
	 * @return 当前对象
	*/
	public PaperRelease setCreateTime(Date createTime) {
		this.createTime=createTime;
		return this;
	}
	
	/**
	 * 获得 修改人ID<br>
	 * 修改人ID
	 * @return 修改人ID
	*/
	public String getUpdateBy() {
		return updateBy;
	}
	
	/**
	 * 设置 修改人ID
	 * @param updateBy 修改人ID
	 * @return 当前对象
	*/
	public PaperRelease setUpdateBy(String updateBy) {
		this.updateBy=updateBy;
		return this;
	}
	
	/**
	 * 获得 修改时间<br>
	 * 修改时间
	 * @return 修改时间
	*/
	public Date getUpdateTime() {
		return updateTime;
	}
	
	/**
	 * 设置 修改时间
	 * @param updateTime 修改时间
	 * @return 当前对象
	*/
	public PaperRelease setUpdateTime(Date updateTime) {
		this.updateTime=updateTime;
		return this;
	}
	
	/**
	 * 获得 是否已删除<br>
	 * 是否已删除
	 * @return 是否已删除
	*/
	public Integer getDeleted() {
		return deleted;
	}
	
	/**
	 * 获得 是否已删除 的投影属性<br>
	 * 等价于 getDeleted 方法，获得对应的枚举类型
	 * @return 是否已删除
	*/
	@Transient
	public Boolean isDeleted() {
		if(this.deletedBool==null) {
			this.deletedBool=DataParser.parseBoolean(deleted);
		}
		return this.deletedBool ;
	}
	
	/**
	 * 设置 是否已删除
	 * @param deleted 是否已删除
	 * @return 当前对象
	*/
	@JsonProperty("deleted")
	public PaperRelease setDeleted(Integer deleted) {
		this.deleted=deleted;
		this.deletedBool=DataParser.parseBoolean(deleted);
		return this;
	}
	
	/**
	 * 设置 是否已删除的投影属性，等同于设置 是否已删除
	 * @param deletedBool 是否已删除
	 * @return 当前对象
	*/
	@Transient
	public PaperRelease setDeleted(Boolean deletedBool) {
		if(deletedBool==null) {
			this.deleted=null;
		} else {
			this.deleted=deletedBool?1:0;
		}
		this.deletedBool=deletedBool;
		return this;
	}
	
	/**
	 * 获得 删除人ID<br>
	 * 删除人ID
	 * @return 删除人ID
	*/
	public String getDeleteBy() {
		return deleteBy;
	}
	
	/**
	 * 设置 删除人ID
	 * @param deleteBy 删除人ID
	 * @return 当前对象
	*/
	public PaperRelease setDeleteBy(String deleteBy) {
		this.deleteBy=deleteBy;
		return this;
	}
	
	/**
	 * 获得 删除时间<br>
	 * 删除时间
	 * @return 删除时间
	*/
	public Date getDeleteTime() {
		return deleteTime;
	}
	
	/**
	 * 设置 删除时间
	 * @param deleteTime 删除时间
	 * @return 当前对象
	*/
	public PaperRelease setDeleteTime(Date deleteTime) {
		this.deleteTime=deleteTime;
		return this;
	}
	
	/**
	 * 获得 version<br>
	 * version
	 * @return version
	*/
	public Integer getVersion() {
		return version;
	}
	
	/**
	 * 设置 version
	 * @param version version
	 * @return 当前对象
	*/
	public PaperRelease setVersion(Integer version) {
		this.version=version;
		return this;
	}
	
	/**
	 * 获得 所属公司<br>
	 * 所属公司
	 * @return 所属公司
	*/
	public List<Organization> getSelectOrg() {
		return selectOrg;
	}
	
	/**
	 * 设置 所属公司
	 * @param selectOrg 所属公司
	 * @return 当前对象
	*/
	public PaperRelease setSelectOrg(List<Organization> selectOrg) {
		this.selectOrg=selectOrg;
		return this;
	}
	
	/**
	 * 添加 所属公司
	 * @param entity 所属公司
	 * @return 当前对象
	*/
	public PaperRelease addSelectOrg(Organization... entity) {
		if(this.selectOrg==null) {
			selectOrg=new ArrayList<>();
		}
		this.selectOrg.addAll(Arrays.asList(entity));
		return this;
	}
	
	/**
	 * 获得 使用公司/部门<br>
	 * 使用公司/部门
	 * @return 使用公司/部门
	*/
	public List<String> getSelectOrgIds() {
		return selectOrgIds;
	}
	
	/**
	 * 设置 使用公司/部门
	 * @param selectOrgIds 使用公司/部门
	 * @return 当前对象
	*/
	public PaperRelease setSelectOrgIds(List<String> selectOrgIds) {
		this.selectOrgIds=selectOrgIds;
		return this;
	}
	
	/**
	 * 添加 使用公司/部门
	 * @param selectOrgId 使用公司/部门
	 * @return 当前对象
	*/
	public PaperRelease addSelectOrgId(String... selectOrgId) {
		if(this.selectOrgIds==null) {
			selectOrgIds=new ArrayList<>();
		}
		this.selectOrgIds.addAll(Arrays.asList(selectOrgId));
		return this;
	}
	
	/**
	 * 获得 选择人员<br>
	 * 选择人员
	 * @return 选择人员
	*/
	public List<Employee> getSelectUser() {
		return selectUser;
	}
	
	/**
	 * 设置 选择人员
	 * @param selectUser 选择人员
	 * @return 当前对象
	*/
	public PaperRelease setSelectUser(List<Employee> selectUser) {
		this.selectUser=selectUser;
		return this;
	}
	
	/**
	 * 添加 选择人员
	 * @param entity 选择人员
	 * @return 当前对象
	*/
	public PaperRelease addSelectUser(Employee... entity) {
		if(this.selectUser==null) {
			selectUser=new ArrayList<>();
		}
		this.selectUser.addAll(Arrays.asList(entity));
		return this;
	}
	
	/**
	 * 获得 选择人员<br>
	 * 选择人员
	 * @return 选择人员
	*/
	public List<String> getSelectUserIds() {
		return selectUserIds;
	}
	
	/**
	 * 设置 选择人员
	 * @param selectUserIds 选择人员
	 * @return 当前对象
	*/
	public PaperRelease setSelectUserIds(List<String> selectUserIds) {
		this.selectUserIds=selectUserIds;
		return this;
	}
	
	/**
	 * 添加 选择人员
	 * @param selectUserId 选择人员
	 * @return 当前对象
	*/
	public PaperRelease addSelectUserId(String... selectUserId) {
		if(this.selectUserIds==null) {
			selectUserIds=new ArrayList<>();
		}
		this.selectUserIds.addAll(Arrays.asList(selectUserId));
		return this;
	}
	
	/**
	 * 获得 paper<br>
	 * paper
	 * @return paper
	*/
	public Paper getPaper() {
		return paper;
	}
	
	/**
	 * 设置 paper
	 * @param paper paper
	 * @return 当前对象
	*/
	public PaperRelease setPaper(Paper paper) {
		this.paper=paper;
		return this;
	}
	
	/**
	 * 获得 learn<br>
	 * learn
	 * @return learn
	*/
	public Learn getLearn() {
		return learn;
	}
	
	/**
	 * 设置 learn
	 * @param learn learn
	 * @return 当前对象
	*/
	public PaperRelease setLearn(Learn learn) {
		this.learn=learn;
		return this;
	}

	/**
	 * 将自己转换成指定类型的PO
	 * @param poType  PO类型
	 * @return PaperRelease , 转换好的 PaperRelease 对象
	*/
	@Transient
	public <T extends Entity> T toPO(Class<T> poType) {
		return EntityContext.create(poType, this);
	}

	/**
	 * 将自己转换成任意指定类型
	 * @param pojoType  Pojo类型
	 * @return PaperRelease , 转换好的 PoJo 对象
	*/
	@Transient
	public <T> T toPojo(Class<T> pojoType) {
		if(Entity.class.isAssignableFrom(pojoType)) {
			return (T)this.toPO((Class<Entity>)pojoType);
		}
		try {
			T pojo=pojoType.newInstance();
			EntityContext.copyProperties(pojo, this);
			return pojo;
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public PaperRelease clone() {
		return duplicate(true);
	}

	/**
	 * 复制当前对象
	 * @param all 是否复制全部属性，当 false 时，仅复制来自数据表的属性
	*/
	@Transient
	public PaperRelease duplicate(boolean all) {
		com.dt.platform.domain.hr.meta.PaperReleaseMeta.$$proxy$$ inst = new com.dt.platform.domain.hr.meta.PaperReleaseMeta.$$proxy$$();
		inst.setSdate(this.getSdate());
		inst.setCode(this.getCode());
		inst.setCost(this.getCost());
		inst.setUpdateTime(this.getUpdateTime());
		inst.setIfAllUser(this.getIfAllUser());
		inst.setEdate(this.getEdate());
		inst.setVersion(this.getVersion());
		inst.setSourcePaperId(this.getSourcePaperId());
		inst.setCreateBy(this.getCreateBy());
		inst.setDeleted(this.getDeleted());
		inst.setSelOrg(this.getSelOrg());
		inst.setCreateTime(this.getCreateTime());
		inst.setUpdateBy(this.getUpdateBy());
		inst.setDeleteTime(this.getDeleteTime());
		inst.setReleaseStatus(this.getReleaseStatus());
		inst.setLearnId(this.getLearnId());
		inst.setDeleteBy(this.getDeleteBy());
		inst.setId(this.getId());
		inst.setIfLearn(this.getIfLearn());
		inst.setPaperId(this.getPaperId());
		inst.setStatus(this.getStatus());
		inst.setRcdTime(this.getRcdTime());
		if(all) {
			inst.setSelectOrg(this.getSelectOrg());
			inst.setPaper(this.getPaper());
			inst.setLearn(this.getLearn());
			inst.setSelectUserIds(this.getSelectUserIds());
			inst.setSelectUser(this.getSelectUser());
			inst.setSelectOrgIds(this.getSelectOrgIds());
		}
		inst.clearModifies();
		return inst;
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public PaperRelease clone(boolean deep) {
		return EntityContext.clone(PaperRelease.class,this,deep);
	}

	/**
	 * 将 Map 转换成 PaperRelease
	 * @param paperReleaseMap 包含实体信息的 Map 对象
	 * @return PaperRelease , 转换好的的 PaperRelease 对象
	*/
	@Transient
	public static PaperRelease createFrom(Map<String,Object> paperReleaseMap) {
		if(paperReleaseMap==null) return null;
		PaperRelease po = create();
		EntityContext.copyProperties(po,paperReleaseMap);
		po.clearModifies();
		return po;
	}

	/**
	 * 将 Pojo 转换成 PaperRelease
	 * @param pojo 包含实体信息的 Pojo 对象
	 * @return PaperRelease , 转换好的的 PaperRelease 对象
	*/
	@Transient
	public static PaperRelease createFrom(Object pojo) {
		if(pojo==null) return null;
		PaperRelease po = create();
		EntityContext.copyProperties(po,pojo);
		po.clearModifies();
		return po;
	}

	/**
	 * 创建一个 PaperRelease，等同于 new
	 * @return PaperRelease 对象
	*/
	@Transient
	public static PaperRelease create() {
		return new com.dt.platform.domain.hr.meta.PaperReleaseMeta.$$proxy$$();
	}

	/**
	 * 从 Map 读取
	 * @param map 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(Map<String, Object> map,boolean cast) {
		if(map==null) return false;
		if(cast) {
			this.setSdate(DataParser.parse(Date.class, map.get(PaperReleaseMeta.SDATE)));
			this.setCode(DataParser.parse(String.class, map.get(PaperReleaseMeta.CODE)));
			this.setCost(DataParser.parse(Integer.class, map.get(PaperReleaseMeta.COST)));
			this.setUpdateTime(DataParser.parse(Date.class, map.get(PaperReleaseMeta.UPDATE_TIME)));
			this.setIfAllUser(DataParser.parse(String.class, map.get(PaperReleaseMeta.IF_ALL_USER)));
			this.setEdate(DataParser.parse(Date.class, map.get(PaperReleaseMeta.EDATE)));
			this.setVersion(DataParser.parse(Integer.class, map.get(PaperReleaseMeta.VERSION)));
			this.setSourcePaperId(DataParser.parse(String.class, map.get(PaperReleaseMeta.SOURCE_PAPER_ID)));
			this.setCreateBy(DataParser.parse(String.class, map.get(PaperReleaseMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, map.get(PaperReleaseMeta.DELETED)));
			this.setSelOrg(DataParser.parse(String.class, map.get(PaperReleaseMeta.SEL_ORG)));
			this.setCreateTime(DataParser.parse(Date.class, map.get(PaperReleaseMeta.CREATE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, map.get(PaperReleaseMeta.UPDATE_BY)));
			this.setDeleteTime(DataParser.parse(Date.class, map.get(PaperReleaseMeta.DELETE_TIME)));
			this.setReleaseStatus(DataParser.parse(String.class, map.get(PaperReleaseMeta.RELEASE_STATUS)));
			this.setLearnId(DataParser.parse(String.class, map.get(PaperReleaseMeta.LEARN_ID)));
			this.setDeleteBy(DataParser.parse(String.class, map.get(PaperReleaseMeta.DELETE_BY)));
			this.setId(DataParser.parse(String.class, map.get(PaperReleaseMeta.ID)));
			this.setIfLearn(DataParser.parse(String.class, map.get(PaperReleaseMeta.IF_LEARN)));
			this.setPaperId(DataParser.parse(String.class, map.get(PaperReleaseMeta.PAPER_ID)));
			this.setStatus(DataParser.parse(String.class, map.get(PaperReleaseMeta.STATUS)));
			this.setRcdTime(DataParser.parse(Date.class, map.get(PaperReleaseMeta.RCD_TIME)));
			// others
			this.setPaper(DataParser.parse(Paper.class, map.get(PaperReleaseMeta.PAPER)));
			this.setLearn(DataParser.parse(Learn.class, map.get(PaperReleaseMeta.LEARN)));
			return true;
		} else {
			try {
				this.setSdate( (Date)map.get(PaperReleaseMeta.SDATE));
				this.setCode( (String)map.get(PaperReleaseMeta.CODE));
				this.setCost( (Integer)map.get(PaperReleaseMeta.COST));
				this.setUpdateTime( (Date)map.get(PaperReleaseMeta.UPDATE_TIME));
				this.setIfAllUser( (String)map.get(PaperReleaseMeta.IF_ALL_USER));
				this.setEdate( (Date)map.get(PaperReleaseMeta.EDATE));
				this.setVersion( (Integer)map.get(PaperReleaseMeta.VERSION));
				this.setSourcePaperId( (String)map.get(PaperReleaseMeta.SOURCE_PAPER_ID));
				this.setCreateBy( (String)map.get(PaperReleaseMeta.CREATE_BY));
				this.setDeleted( (Integer)map.get(PaperReleaseMeta.DELETED));
				this.setSelOrg( (String)map.get(PaperReleaseMeta.SEL_ORG));
				this.setCreateTime( (Date)map.get(PaperReleaseMeta.CREATE_TIME));
				this.setUpdateBy( (String)map.get(PaperReleaseMeta.UPDATE_BY));
				this.setDeleteTime( (Date)map.get(PaperReleaseMeta.DELETE_TIME));
				this.setReleaseStatus( (String)map.get(PaperReleaseMeta.RELEASE_STATUS));
				this.setLearnId( (String)map.get(PaperReleaseMeta.LEARN_ID));
				this.setDeleteBy( (String)map.get(PaperReleaseMeta.DELETE_BY));
				this.setId( (String)map.get(PaperReleaseMeta.ID));
				this.setIfLearn( (String)map.get(PaperReleaseMeta.IF_LEARN));
				this.setPaperId( (String)map.get(PaperReleaseMeta.PAPER_ID));
				this.setStatus( (String)map.get(PaperReleaseMeta.STATUS));
				this.setRcdTime( (Date)map.get(PaperReleaseMeta.RCD_TIME));
				// others
				this.setPaper( (Paper)map.get(PaperReleaseMeta.PAPER));
				this.setLearn( (Learn)map.get(PaperReleaseMeta.LEARN));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}

	/**
	 * 从 Map 读取
	 * @param r 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(ExprRcd r,boolean cast) {
		if(r==null) return false;
		if(cast) {
			this.setSdate(DataParser.parse(Date.class, r.getValue(PaperReleaseMeta.SDATE)));
			this.setCode(DataParser.parse(String.class, r.getValue(PaperReleaseMeta.CODE)));
			this.setCost(DataParser.parse(Integer.class, r.getValue(PaperReleaseMeta.COST)));
			this.setUpdateTime(DataParser.parse(Date.class, r.getValue(PaperReleaseMeta.UPDATE_TIME)));
			this.setIfAllUser(DataParser.parse(String.class, r.getValue(PaperReleaseMeta.IF_ALL_USER)));
			this.setEdate(DataParser.parse(Date.class, r.getValue(PaperReleaseMeta.EDATE)));
			this.setVersion(DataParser.parse(Integer.class, r.getValue(PaperReleaseMeta.VERSION)));
			this.setSourcePaperId(DataParser.parse(String.class, r.getValue(PaperReleaseMeta.SOURCE_PAPER_ID)));
			this.setCreateBy(DataParser.parse(String.class, r.getValue(PaperReleaseMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, r.getValue(PaperReleaseMeta.DELETED)));
			this.setSelOrg(DataParser.parse(String.class, r.getValue(PaperReleaseMeta.SEL_ORG)));
			this.setCreateTime(DataParser.parse(Date.class, r.getValue(PaperReleaseMeta.CREATE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, r.getValue(PaperReleaseMeta.UPDATE_BY)));
			this.setDeleteTime(DataParser.parse(Date.class, r.getValue(PaperReleaseMeta.DELETE_TIME)));
			this.setReleaseStatus(DataParser.parse(String.class, r.getValue(PaperReleaseMeta.RELEASE_STATUS)));
			this.setLearnId(DataParser.parse(String.class, r.getValue(PaperReleaseMeta.LEARN_ID)));
			this.setDeleteBy(DataParser.parse(String.class, r.getValue(PaperReleaseMeta.DELETE_BY)));
			this.setId(DataParser.parse(String.class, r.getValue(PaperReleaseMeta.ID)));
			this.setIfLearn(DataParser.parse(String.class, r.getValue(PaperReleaseMeta.IF_LEARN)));
			this.setPaperId(DataParser.parse(String.class, r.getValue(PaperReleaseMeta.PAPER_ID)));
			this.setStatus(DataParser.parse(String.class, r.getValue(PaperReleaseMeta.STATUS)));
			this.setRcdTime(DataParser.parse(Date.class, r.getValue(PaperReleaseMeta.RCD_TIME)));
			return true;
		} else {
			try {
				this.setSdate( (Date)r.getValue(PaperReleaseMeta.SDATE));
				this.setCode( (String)r.getValue(PaperReleaseMeta.CODE));
				this.setCost( (Integer)r.getValue(PaperReleaseMeta.COST));
				this.setUpdateTime( (Date)r.getValue(PaperReleaseMeta.UPDATE_TIME));
				this.setIfAllUser( (String)r.getValue(PaperReleaseMeta.IF_ALL_USER));
				this.setEdate( (Date)r.getValue(PaperReleaseMeta.EDATE));
				this.setVersion( (Integer)r.getValue(PaperReleaseMeta.VERSION));
				this.setSourcePaperId( (String)r.getValue(PaperReleaseMeta.SOURCE_PAPER_ID));
				this.setCreateBy( (String)r.getValue(PaperReleaseMeta.CREATE_BY));
				this.setDeleted( (Integer)r.getValue(PaperReleaseMeta.DELETED));
				this.setSelOrg( (String)r.getValue(PaperReleaseMeta.SEL_ORG));
				this.setCreateTime( (Date)r.getValue(PaperReleaseMeta.CREATE_TIME));
				this.setUpdateBy( (String)r.getValue(PaperReleaseMeta.UPDATE_BY));
				this.setDeleteTime( (Date)r.getValue(PaperReleaseMeta.DELETE_TIME));
				this.setReleaseStatus( (String)r.getValue(PaperReleaseMeta.RELEASE_STATUS));
				this.setLearnId( (String)r.getValue(PaperReleaseMeta.LEARN_ID));
				this.setDeleteBy( (String)r.getValue(PaperReleaseMeta.DELETE_BY));
				this.setId( (String)r.getValue(PaperReleaseMeta.ID));
				this.setIfLearn( (String)r.getValue(PaperReleaseMeta.IF_LEARN));
				this.setPaperId( (String)r.getValue(PaperReleaseMeta.PAPER_ID));
				this.setStatus( (String)r.getValue(PaperReleaseMeta.STATUS));
				this.setRcdTime( (Date)r.getValue(PaperReleaseMeta.RCD_TIME));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}
}